<?php


abstract class Registry
{
    const LOGGER = 'logger';

    private static $storedValues = [];
    private static $allowedKeys = [
        self::LOGGER
    ];

    public static function set($key,$value)
    {
        if (!in_array($key,self::$allowedKeys)) {
            throw new \http\Exception\InvalidArgumentException('Invalid key given');
        }
        self::$storedValues[$key] = $value;
    }

    public static function get($key)
    {
        if (!in_array($key,self::$allowedKeys) || !isset(self::$storedValues[$key])) {
            throw new \http\Exception\InvalidArgumentException('Invalid key given');
        }
        return self::$storedValues[$key];
    }
}